package com.example.tcpmaster.callback;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.example.tcpmaster.TcpClient;
import com.example.tcpmaster.interfaces.IRelease;
import com.example.tcpmaster.interfaces.OnTcpClientStateListener;
import com.example.tcpmaster.interfaces.OnTcpUICallBackStateListener;

/**
 * Created by lianxiang on 2017/9/6.
 * TCP UI刷新，单独解耦。
 */

public abstract  class AbsTcpUICallBack implements OnTcpUICallBackStateListener,IRelease {
    protected Context mContext;
    protected View mViewGroup;
    protected TcpClient mTcpClient;

    public AbsTcpUICallBack(Context context, View viewGroup) {
        this.mContext = context;
        this.mViewGroup = viewGroup;
        init(context,viewGroup);
    }

    /**
     * 绑定TcpClient
     * @param tcpClient
     */
    public void bindTcpClient(TcpClient tcpClient){
        this.mTcpClient = tcpClient;
    }

    protected abstract  void init(Context context, View viewGroup);
}
